/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package haw.pr2.A2a.implementations;
import haw.pr2.A2a.interfaces.*;
/**
 *
 * @author Fabian Heidorn, Alexander Kaack
 */
public class TimeDiffInS extends AbstractScalar<TimeDiff> implements TimeDiff {

    private final double timeDiffInS;
    
    public TimeDiffInS(double timeDiffInS) {
        this.timeDiffInS=timeDiffInS;
    }

    @Override
    public TimeDiffInS inverse() {
        return new TimeDiffInS(-this.s());
    }

    @Override
    public TimeDiffInS add(TimeDiff value) {
        return new TimeDiffInS(this.s()+value.s());
    }

    @Override
    public TimeDiffInS sub(TimeDiff value) {
        return new TimeDiffInS(this.s()-value.s());
    }

    @Override
    public TimeDiffInS mul(TimeDiff value) {
        return new TimeDiffInS(this.s()*value.s());
    }

    @Override
    public TimeDiffInS div(double value) {
        return new TimeDiffInS(this.s()/value);
    }

    @Override
    public double div(TimeDiff value) {
        return this.s()/value.s();
    }

    @Override
    public boolean isZero() {
        return this.s()==ZERO_TIMEDIFF.s();
    }

    @Override
    public boolean isValid() {
        return true;
    }

    @Override
    public double us() {
        return this.s()*S_IN_US;
    }

    @Override
    public double ms() {
        return this.s()*S_IN_MS;
    }

    @Override
    public double s() {
        return this.timeDiffInS;
    }
    
    @Override
    public double m() {
        return this.s()*S_IN_M;
    }
    
    @Override
    public double h() {
        return this.s()*S_IN_H;
    }
    
}

